export function request(con) {
	const {method='get',header={},data={}}=con
	header['access-key']='735151'
	return new Promise((resovle, reject) => {
		uni.request({
			url: con.url,
			method,
			header,
			data,
			success: (res) => {
				if (res.data.errCode === 0) {
					resovle(res.data)
				} else if (res.data.errCode === 400) {
					uni.showModal({
						title: "错误提示",
						icon: "error",
						content: res.data.errMsg,
						showCancel: false
					})
					reject(res.data)
				} else {
					uni.showToast({
						title: "错误提示",
						icon: "error"
					})
					reject(res.data)
				}
			},
			fail: (res) => {
				uni.showToast({
					title: "错误提示",
					icon: "error"
				})
				reject(res.data)
			}
		})
	})
}